<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>B页面</title>
</head>
<body>
    <h1>点击传输数据</h1>
</body>
<script>
    /* 创建一个广播通道 */
const channelObj = new BroadcastChannel('televiseChannel');
 
 // 监听消息事件
 channelObj.onmessage = function(event) {
   const newData = event.data;
   console.log('收到的更新数据：', newData);
 };
</script>
</html>